//
// emballage.cpp for  in /home/former_b/Local/Piscine/cpp/Colle_1
// 
// Made by bastien formery
// Login   <former_b@epitech.net>
// 
// Started on  Sat Sep 11 14:04:13 2010 bastien formery
// Last update Sat Sep 11 17:55:20 2010 bastien formery
//

#include "emballage.h"

Emballage::Emballage()
{
  _isEmpty = true;
  _isOpen = true;
  _objet = NULL;
  std::cout << "sifflet en travaillant" << std::endl;
}

Emballage::~Emballage()
{

}

void Emballage::emballerEmballage(Objet* & o)
{
  if (_isEmpty && _isOpen && this != o)
    {
      _objet = o;
      _isOpen = false;
      _isEmpty = false;
      std::cout << "tuuuut tuuut tuut" << std::endl;
    }
}

void Emballage::ouvrirEmballage()
{
  _isOpen = true;
}

Objet* & Emballage::prendreObjet()
{
  if (_isOpen && !_isEmpty)
    _isEmpty = true;
  return (_objet);
}
